#include <iostream>
#include <queue>

using namespace std;


int main()
{
	int n, k;
	cin >> n >> k;
	priority_queue<int> q;
	int x;
	long long int sum = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> x;
		if (x % 2 == 1)
		{
			sum += x;
		}
		else
		{
			q.push(x);
		}
	}

	while (k-- && q.size())
	{
		x = q.top();
		q.pop();
		x /= 2;
		if (x % 2 == 1)
		{
			sum += x;
		}
		else
		{
			q.push(x);
		}
	}

	while (q.size())
	{
		sum += q.top();
		q.pop();
	}

	cout << sum << endl;
	return 0;
}
